<template>
	<view class="page" @click="navigator">
		<view>
			<text class="city">{{ city.name }}</text>
		</view>
		<view class="search">
				<uni-icons type="search" size="22" color="#fff"></uni-icons>
		</view>
	
		
	</view>
</template>

<script>
export default {
	name: 'searchBar',
	data() {
		return {
			// 当前选择的城市
			city: {
				code: '',
				name: '定位中...'
			},
			// 热门城市
			hotCity: [
				{ code: '110100', name: '北京' },
				{ code: '310100', name: '上海' },
				{ code: '330100', name: '杭州' },
				{ code: '440100', name: '广州' },
				{ code: '440300', name: '深圳' },
				{ code: '320100', name: '南京' },
				{ code: '500100', name: '重庆' },
				{ code: '510100', name: '成都' }
			]
		};
	},
	onLoad() {},
	methods: {
		// 点击城市选项
		select(city) {
			this.city = city;
			console.log("城市",city);
		},
		// 打开城市选择页面
		navigator() {
			uni.navigateTo({
				url:'/pages/searchLocation/searchLocation',
				animationType:'fade-in'
			})
		}
	}
};
</script>

<style lang="scss" scoped>
.page {
	position: fixed;
	display: flex;
	flex-direction: row;
	align-items: center;
	top: 65rpx;
	right: 50rpx;
	z-index: 1000;
	width: 250rpx;
	height: 55rpx;
	border-radius: 30rpx;
	background-color: #55aaff;
}
.city {
	color: #fff;
	font-size: 25rpx;
	flex: 1;
}
.search{
	align-items: flex-end;
}
</style>
